<template>
	<xn-form-container title="详情" :width="1000" :visible="visible" :destroy-on-close="true" @close="onclose">
		<a-table
			:columns="columns"
			:data-source="dataSource"
			:pagination="false"
			:row-key="(record) => record.id"
			:scroll="{ x: 'max-content' }"
			bordered
		></a-table>
	</xn-form-container>
</template>

<script setup name="detailList">
	import gzxRepairPhonenumberApi from '@/api/tjzy/repair/repair/gzxRepairPhonenumberApi'

	const visible = ref(false)
	const emit = defineEmits({ successful: null })
	const onclose = () => {
		visible.value = false
	}

	const columns = ref([
		{
			title: '姓名',
			dataIndex: 'name'
		},
		{
			title: 'callID',
			dataIndex: 'id'
		},
		{
			title: '联通的客户ID',
			dataIndex: 'ltUnicomCustomerId'
		},
		{
			title: '联通的批次ID',
			dataIndex: 'ltBatchId'
		},
		{
			title: '移动给的批次号',
			dataIndex: 'ydBatchno'
		},
		{
			title: '移动电话序号',
			dataIndex: 'ydPhoneSeqNo'
		},
		{
			title: '移动电话号码的区号',
			dataIndex: 'ydPhoneAreaCode'
		}
	])
	const searchFormParam = reactive({
		id: undefined
	})
	const searchFormState = reactive({
		id: undefined
	})
	const dataSource = ref([])
	const loadData = (params) => {
		const searchFormParam = JSON.parse(JSON.stringify(searchFormState))
		return gzxRepairPhonenumberApi.getRepairResult(searchFormParam).then((res) => {
			dataSource.value = res
		})
	}
	// 打开抽屉
	const onOpen = (record) => {
		visible.value = true
		let params = {
			id: record.id
		}
		gzxRepairPhonenumberApi.getRepairResult(params).then((res) => {
			dataSource.value = res
		})
	}
	// 调用这个函数将子组件的一些数据和方法暴露出去
	defineExpose({
		onOpen
	})
</script>

<style scoped></style>
